package com.anolesoft.amljmes.foreknow.service.impl;

import com.anolesoft.amljmes.foreknow.bo.MesBzzPtdmx;
import com.anolesoft.amljmes.foreknow.dto.MesBzzPtdDto;
import com.anolesoft.amljmes.foreknow.mapper.MesBzzPtdMapper;
import com.anolesoft.amljmes.foreknow.service.MesBzzPtdService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

@Service
public class MesBzzPtdServiceImpl implements MesBzzPtdService {

    @Autowired
    private MesBzzPtdMapper mapper;


    @Override
    public List<MesBzzPtdmx> query(MesBzzPtdDto dto) {
        MesBzzPtdDto ptdDto = new MesBzzPtdDto();
        if (dto.getSupportingOrderNo().trim() != null){
            ptdDto.setSupportingOrderNo(dto.getSupportingOrderNo().trim());
        }if (dto.getOrderNumber().trim() != null){
            ptdDto.setOrderNumber(dto.getOrderNumber().trim());
        }
        ptdDto.setFactoryCode(dto.getFactoryCode());
        return mapper.query(ptdDto);
    }

}
